<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0" />
<title>检定记录</title>
<script>
		$(document).ready(function() {
		 $("#testDate").addClass("Wate").bind("click", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'%y-%M-%d',maxDate:'#F{$dp.$D(\'nextTestDate\')}',dateFmt:'yyyy-MM-dd'});});
		 $("#nextTestDate").addClass("Wate").bind("focus", function(){
    	 WdatePicker({skin:'whyGreen',minDate:'#F{$dp.$D(\'testDate\')}',dateFmt:'yyyy-MM-dd'});});
		});
		function batchAdd(action,form){
		    if (confirm('确定执行[添加]操作?')){
		        form.action = action;
		        form.submit();
		    }
		}
	</script>
</head>
<body>
<div id="message"><s:actionmessage theme="custom"
	cssClass="success" /></div>
<form id="mainForm" action="${ctx }/asset/equipment/check.action" method="post" class="yform">
<div id="filter">
<ul>
<li>检定时间:<input type="text" id="testDate" name="testDate" value="${testDate}" />
<input type="hidden" name="id" value="${id}" /></li>
<li>下次检定时间:<input type="text" id="nextTestDate" name="nextTestDate" value="${nextTestDate}" /></li>
<li>备注:<input type="text" name="remark" value="${remark}" />
		<input type="hidden" name="equipId" value="${equipId}" /></li>
</ul>
<div class="type-button">
<input type="button" onclick="batchAdd('${ctx }/asset/equipment/check!save.action',document.forms.mainForm)" value="添加" />
</div>
</div>
<div id="content">
<table id="contentTable">
	<tr>
		<td><a id="createDate" href="javascript:sort('createDate','asc')">序号</a></td>
		<th><a id="equipInformation.equipmentModel" href="javascript:sort('equipInformation.equipmentModel','asc')">设备名称</a></th>
		<th><a id="equipInformation.equipmentNo" href="javascript:sort('equipInformation.equipmentNo','asc')">设备编号</a></th>
		<th>操作</th>
	</tr>
	<c:forEach items="${page.result}" var="check" varStatus="status">
		<c:choose>
			<c:when test="${check!=null}">
				<tr>
					<td>${pag.first+1+status.index }</td>
					<td>${check.equipInformation.equipmentModel}</td>
					<td>${check.equipInformation.equipmentNo}</td>
					<td><a
						href="${ctx}/asset/equipment/check!input.action?id=${check.id}&equipId=${check.equipInformation.id}">编辑</a>
					<a
						href="${ctx}/asset/equipment/check!delete.action?id=${check.id}&equipId=${check.equipInformation.id}" onclick="return confirmDelete();">删除</a>
					</td>
				</tr>
			</c:when>
			<c:otherwise>
				<tr>
					<td colspan="4">当前设备无检定记录！</td>
				</tr>
			</c:otherwise>
		</c:choose>
	</c:forEach>
</table>
</div>
</form>
</body>
</html>
